#ifndef SWKNXPROTOCOL_H
#define SWKNXPROTOCOL_H

#include <QObject>
#include "Protocol/BaseProtocol.h"
#include "DataType/PortStruct.h"
#include "System/CheckCode.h"

class SWKNXProtocol: public BaseProtocol
{
    Q_OBJECT
public:
    explicit SWKNXProtocol(QObject *parent = 0);
    QList<Package> parseData(QByteArray data);
    QByteArray generateData(Package package);

    enum FunctionCode
    {
         writeMac = 0XA0,
         readMac = 0xA1,
         ackMac = 0xB1,
         readLineStatus = 0xA2,
         ackLineStatus = 0xB2,
         reboot = 0XC0,
         programLed = 0XC1,
         readKnxCtl = 0x18,
        writeKnxCtl = 0x18,
    };

private:

    enum CheckSteps
    {
        CHECK_HEAD,
        CHECK_VERSION,
        CHECK_ID,
        CHECK_FUNCTION,
        CHECK_LENGTH,
        CHECK_BODY,
        CHECK_CHECKCODE,
    };
};

#endif // SWKNXPROTOCOL_H
